home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13142 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.uh.edu!usenet
  2. From: Sensarn <txs53132@bayou.uh.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: Is this possible?
  5. Date: Sat, 23 Mar 1996 11:32:18 -0800
  6. Organization: AEtna Insurance Agency
  7. Message-ID: <315451C2.18E9@bayou.uh.edu>
  8. NNTP-Posting-Host: sip-14262.public-dialups.uh.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.01 (Win16; I)
  13.  
  14. Is it possible to use NEW for FAR memory allocation in the SMALL 
  15. memory model?  I get NULL POINTER ASSIGNMENT when I try this using 
  16. farmalloc() for my FAR allocation:
  17.  
  18. unsigned char **ptr; /* Pointer to unsigned char pointers */
  19. ptr=(unsigned char far **)farmalloc(1); /* Create a pointer */
  20. ptr[0]=(unsigned char far *)farmalloc(64001); /* Allocate memory */
  21.  
  22. I want to create an array of pointers -- each pointing to 64016 bytes -- 
  23. I get NULL POINTER ASSIGNMENT instead.  I tried this:
  24.  
  25. unsigned char far **ptr;
  26. ptr=new unsigned char far *[1];
  27. ptr[0]=new unsigned char far[64001];
  28.  
  29. I got no errors -- except for the fact that I didn't have enough NEAR 
  30. heap for the allocation.  Please try to help me,
  31.  
  32. -- 
  33. ______________________________
  34.  
  35. Steven Sensarn
  36. E-Mail - txs53132@bayou.uh.edu
  37. ______________________________
  38.